package com.jiepu.daily.corejava.advanceed.part6thread;

import org.jetbrains.annotations.NotNull;

/**
 * @Description:
 * @author: xinjie.txt
 * @date: 2020/7/29  10:37
 */
public class Window extends Thread {
	private static int ticket = 100;

	public Window() {
	}

	public Window(@NotNull String name) {
		super(name);
	}

	@Override
	public void run() {
		while (ticket > 0) {
			//synchronized (Object.class) {
				System.out.println(this.getName() + "  The rest tickets: " + --ticket);
			//}
		}
	}
}
